<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<base href="<%=request.getContextPath()%>/">
<link rel="stylesheet" href="about/css/bootstrap.min.css">
<link href="about/css/myCss.css" type="text/css" rel="stylesheet">
<link href="about/css/main.css" type="text/css" rel="stylesheet">
<link href="about/css/base.css" type="text/css" rel="stylesheet">
<!--按钮样式表-->
<link href="about/css/btn.css" type="text/css" rel="stylesheet">
<link href="about/css/css.css" type="text/css" rel="stylesheet">
<link href="about/css/index.css" type="text/css" rel="stylesheet">
<link href="about/css/search.css" type="text/css" rel="stylesheet">
	

<script src="about/js/jquery.min.js"></script>
<title>Insert title here</title>
<style>
      .cw_img_lg{
			width:50px;
		}
		.cw_img_lg img{
			width:100%;
			height: 100%;
			margin-left: 55%;
		}
		.ml15{
			margin-left: 15px;
		}
		label{
			margin-left: 15px;
		}
		.list_style{
			list-style: disc outside none;
		}
       .cwsyt_thead{
			background-color: #0168b7;
		}
		.cwsyt_tbody{
			height: 120px;
			text-align: center;
		}
		.room_id{
			color:white;
			width: 100px;
			height: 20px;
			text-align: center;
		}
		.img{
		 text-align: center;
		}
		</style>
		<script type="text/javascript">
		 function Refresh(){
	    		window.location.href="/beadhouse/api/bed/selectAll";
	    	};	
		 
	     function Retreat(id,customerId){
	    		var url="/beadhouse/api/bed/deleteCustomer";
	    		$.get(url,{id:id,
	    			      customerId:customerId
	    		},function(r){
	    		});		
	    	};
	    function add(id){
	    	window.location.href="/beadhouse/api/bed/addJsp?id="+id;
	    };
	    function replace(id,customerId){
	    	window.location.href="/beadhouse/api/bed/replaceBedJsp?id="+id+"&customerId="+customerId;
	    };
	    function check(id){
	    	window.location.href="/beadhouse/api/bed/customerJsp?id="+id;
	    };
	  
	     
		</script>
</head>
<body>




<div class="col-md-12 pd0">
								<table><tr>
									
									<td style="width:140px">
										<div class="cw_img ml15"><img src="about/images/jhnlc.png"/></div>
										<span class="cw_num"><b>总床数：</b>${cum}</span>
									</td>
									<td style="width:140px">
										<div>
											<div class="cw_img ml10"><img src="about/images/kx.png"/></div>
											<span class="cw_num"><b>空闲：</b>${num2}</span>
										</div>
										<div>
											<div class="cw_img ml10"><img src="about/images/yr.png"/></div>
											<span class="cw_num"><b>有人：</b>${num1}</span>
										</div>
									</td>
									<td style="width:140px">
										<div>
											<div class="cw_img ml10"><img src="about/images/lccs.png"/></div>
											<span class="cw_num"><b>破损：</b>${num4}</span>
										</div>
										<div>
											<div class="cw_img ml10"><img src="about/images/tz.png"/></div>
											<span class="cw_num"><b>办理退住：</b>${num3}</span>
										</div>
										
									</td>
									<td style="width:140px">
										<div>
											<button type="hidden" id="id"  onclick="Refresh()">同步信息</button>
											
										</div>
										
									</td>
								</tr></table>
								<table border="1px" cellspacing="20px" class="table-bordered">
									<tbody>
									
										<tr class="cwsyt_thead">
											<td class="room_id">2101</td>
											<td class="room_id" rowspan="2" style="background-color:#AEEEEE">电梯厅</td>
											<td class="room_id" rowspan="2" colspan="2" style="background-color:#9AC0CD">洗衣房</td>
											<td class="room_id" rowspan="2" colspan="2" style="background-color:#4EEE94">活动中心</td>
											<td class="room_id">2102</td>
											<td class="room_id">2103</td>
											<td class="room_id">2104</td>
											<td class="room_id"  rowspan="2" style="background-color:#CDAA7D">走道</td>
											<td class="room_id">2105</td>
											<td class="room_id">2106</td>
										</tr>
										
										<c:forEach var="r" items="${data}"  varStatus="vs">
											<td>
												<a href="javascript:void(0)" style="text-decoration: none;"> 
												<c:if test="${r.remark eq null}">                      
											        <c:if test="${r.bedStatus}">
											          <div class="img">
											            <img src="about/images/yr.png"/>
											             
											             <button type="hidden" id="id" onclick="check(${r.useCustomerId})">查看</button>
											            </div>&nbsp;&nbsp;&nbsp;&nbsp;${vs.index+1}号床  
											            
											        </c:if>
												    <c:if test="${!r.bedStatus}">
												    <div class="img"><img src="about/images/kx.png"/>
												    
											            <button type="hidden" id="id"  onclick="add(${r.id})">添加</button>
												    </div>&nbsp;&nbsp;&nbsp;&nbsp;${vs.index+1}号床</c:if>
												 </c:if>
												    <c:if test="${r.remark==0}">
												    <div class="img"><img src="about/images/lccs.png"/>
												     
											             <button type="hidden" id="id" onclick="replace(${r.id},${r.useCustomerId})">换床</button>
												    </div>&nbsp;&nbsp;&nbsp;&nbsp;${vs.index+1}号床</c:if>
												    <c:if test="${r.remark==1}">
												    <div class="img"><img src="about/images/tz.png"/>
												    
											             <button type="hidden" id="id"  onclick="Retreat(${r.id},${r.useCustomerId})">退住</button>
												    </div>&nbsp;&nbsp;&nbsp;&nbsp;${vs.index+1}号床</c:if>
												</a>	
												
											</td>
											<c:if test="${(vs.index+1)==6}">
                                           <tr class="cwsyt_thead">
                                           <c:forEach var="a" begin="0" end="11">
                                          <a href="javascript:void(0)" style="text-decoration: none;"> 
                                          <td class="room_id" value="a">${a+2201}</td>
                                           
                                           </c:forEach>
                                         
								           </c:if>	
								           <c:if test="${(vs.index+1)%12==6}">
                                           </tr>
								           </c:if>		
										</c:forEach>	
										</tr>
									
									</tbody>
								</table>
						
							</div>
						</div>
					</div>

	 
	 
	  

</body>
</html>